#!/usr/bin/expect

set timeout 5
set name [lindex $argv 0]
set pwd [lindex $argv 1]
set app [lindex $argv 2]
spawn ssh -p 60022 $name@10.10.225.120
expect "*password*"
send "$pwd\r"
expect "USMshell:"
send "ssh 106.75.14.105\r"
expect "yhhy@"
send "ssh 10.19.98.107\r"
expect "98.107"
if { $app == "--pc" } {
	send "exit\r"
	expect "187.125"
	send "ssh 10.19.91.155\r"
	expect "14.51"
	send "tailf /data/app/partner-center/logs/run.log\r"
} else	{
	if { $app == "--pra"} {
	send "tailf /data/app/partner-rest-api-tomcat/logs/run.log\r"
	}
}
interact

